/**
 * <copyright>
 * </copyright>
 *
 */
package org.xtext.telcodev.dsl.voiS.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.xtext.telcodev.dsl.voiS.Save;
import org.xtext.telcodev.dsl.voiS.Vars;
import org.xtext.telcodev.dsl.voiS.VoiSPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Save</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.telcodev.dsl.voiS.impl.SaveImpl#getThat <em>That</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SaveImpl extends StateAbstractElementImpl implements Save
{
  /**
   * The cached value of the '{@link #getThat() <em>That</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getThat()
   * @generated
   * @ordered
   */
  protected Vars that;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected SaveImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return VoiSPackage.Literals.SAVE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Vars getThat()
  {
    if (that != null && that.eIsProxy())
    {
      InternalEObject oldThat = (InternalEObject)that;
      that = (Vars)eResolveProxy(oldThat);
      if (that != oldThat)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, VoiSPackage.SAVE__THAT, oldThat, that));
      }
    }
    return that;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Vars basicGetThat()
  {
    return that;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setThat(Vars newThat)
  {
    Vars oldThat = that;
    that = newThat;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, VoiSPackage.SAVE__THAT, oldThat, that));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case VoiSPackage.SAVE__THAT:
        if (resolve) return getThat();
        return basicGetThat();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case VoiSPackage.SAVE__THAT:
        setThat((Vars)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case VoiSPackage.SAVE__THAT:
        setThat((Vars)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case VoiSPackage.SAVE__THAT:
        return that != null;
    }
    return super.eIsSet(featureID);
  }

} //SaveImpl
